package com.pattern.structural.composite;

import java.util.ArrayList;
import java.util.List;

public class Folder implements IDoc {
	
	private List<IDoc> folder = new ArrayList<IDoc>();
	
	public int getCount() {
		int count = 0;
		for(IDoc doc : folder)
			count += doc.getCount();
		return count;
	}
	
	public void print() {
		for(IDoc doc : folder)
			doc.print();
	}

	public boolean add(IDoc doc) {
		return folder.add(doc);
	}
	
	public boolean remove(IDoc doc) {
		return folder.remove(doc);
	}

}
